<script setup>
import { ref } from "vue";
const emit = defineEmits(["changeTab"]);
const value1 = ref(0);
const change1 = (val) => {
  value1.value = val;
};

const clickTab = (index) => {
  emit("changeTab", index);
};
</script>
<template>
  <up-tabbar
    :value="value1"
    @change="change1"
    :placeholder="false"
    :safeAreaInsetBottom="false"
  >
    <up-tabbar-item
      text="首页"
      icon="home"
      @click="clickTab(0)"
    ></up-tabbar-item>
    <up-tabbar-item
      text="论坛"
      icon="chat"
      @click="clickTab(1)"
    ></up-tabbar-item>
    <!-- <up-tabbar-item text="新品" icon="bag" @click="clickTab(2)"></up-tabbar-item> -->
    <up-tabbar-item
      text="购物车"
      icon="shopping-cart"
      @click="clickTab(2)"
    ></up-tabbar-item>
    <up-tabbar-item
      text="我的"
      icon="account"
      @click="clickTab(3)"
    ></up-tabbar-item>
  </up-tabbar>
</template>